package com.xmuexp109.exp5.service;

import com.xmuexp109.exp5.model.ordersVo;
import com.xmuexp109.exp5.service.ordersService;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@RocketMQMessageListener(topic = "order-create-topic", consumerGroup = "Pro_Group")
@Slf4j
public class InsertorderListener implements RocketMQListener<ordersVo> {
    @Resource
    private ordersService ordersService;

    @Override
    public void onMessage(ordersVo vo) {
        ordersService.createOrders(vo);
    }

}
